﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OpenKey
{
    public partial class FlagDialog : Form
    {
        public FlagDialog()
        {
            InitializeComponent();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (textFlag.Text != "" && textValue.Text != "")
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        public Flag Info
        {
            get
            {
                Flag f = new Flag();
                f.Name = textFlag.Text;
                f.Value = textValue.Text;
                return f;
            }
            set
            {
                textFlag.Text = value.Name;
                textValue.Text = value.Value;
            }
        }
    }
}
